package com.ternnetwork.oa.entity.work;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ternnetwork.oa.enums.work.EventRemindTime;
import com.ternnetwork.persistence.entity.VersionEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;


/**
 *
 * @author xuwenfeng
 *
 */
@Entity
@Table(name="OA_EVENT")
@JsonIgnoreProperties(value={"handler","hibernateLazyInitializer"})
@Data
public class Event extends VersionEntity {
	@Id@Column(name="ID",nullable=false)
	@GeneratedValue(strategy = GenerationType.TABLE,generator="id_gen")
    @TableGenerator(name = "id_gen",pkColumnValue="OA_EVENT_ID",table="AVO_ID_GENERATOR", pkColumnName="GEN_NAME",valueColumnName="GEN_VALUE",allocationSize=1)
	private long id;
	

	@Column(name="title",nullable=false)
	private String title;

	@Temporal(TemporalType.TIMESTAMP)@Column(name="start",nullable = false)
	private Date start;

	@Temporal(TemporalType.TIMESTAMP)@Column(name="end")
	private Date end;

	@Column(name="memo")
	private String memo;

	@Enumerated@Column(name="remind_time")
	private EventRemindTime remindTime=EventRemindTime.NEVER;

	@Override
	public Long getId() {
		return id;
	}
	

}
